home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2001 December / pcwk12201b.iso / Wersje pelne i specjalne / Winamp 2.77 i 3.0beta / wasabi-sdk_beta1.exe / studio / ExampleB / exampleB.h < prev    next >
C/C++ Source or Header  |  2001-10-08  |  5KB  |  153 lines

  1. /*
  2.  
  3.   Nullsoft WASABI Source File License
  4.  
  5.   Copyright 1999-2001 Nullsoft, Inc.
  6.  
  7.     This software is provided 'as-is', without any express or implied
  8.     warranty.  In no event will the authors be held liable for any damages
  9.     arising from the use of this software.
  10.  
  11.     Permission is granted to anyone to use this software for any purpose,
  12.     including commercial applications, and to alter it and redistribute it
  13.     freely, subject to the following restrictions:
  14.  
  15.     1. The origin of this software must not be misrepresented; you must not
  16.        claim that you wrote the original software. If you use this software
  17.        in a product, an acknowledgment in the product documentation would be
  18.        appreciated but is not required.
  19.     2. Altered source versions must be plainly marked as such, and must not be
  20.        misrepresented as being the original software.
  21.     3. This notice may not be removed or altered from any source distribution.
  22.  
  23.  
  24.   Brennan Underwood
  25.   brennan@nullsoft.com
  26.  
  27. */
  28.  
  29. // ===========================================================================
  30. //
  31. //    NULLSOFT WASABI SDK EXAMPLE PROJECTS
  32. //
  33. //      File:     ExampleB.h
  34. //
  35. //!##   Purpose:  Define the ComponentClient class for our example component
  36. //
  37. //      Requires: Please read Example1.h first.
  38. //
  39. //      Notes:    A note on the comments in this document:
  40. //
  41. //                Notes that begin with *** are important notes that everyone
  42. //                needs to read.  The other comments assist readability or
  43. //                explain the thinking behind sections of code which may not
  44. //                be immediately obvious to the novice programmer.
  45. //
  46. //                Or I'm just typing to hear myself clickyclack.
  47. //
  48.  
  49.  
  50. #ifndef _EXAMPLEB_H //EDITME
  51. #define _EXAMPLEB_H //EDITME
  52.  
  53. //
  54. //  There used to be a bunch of comments here.
  55. //  But they didn't say anything terribly important.
  56. //  And they were wildly offensive.
  57. //
  58. //    So I deleted them.  Sorry.
  59. //
  60. #include "../studio/wac.h"
  61. #include "../common/SimpleWndCreate.h"
  62.  
  63.  
  64. class ExampleBWnd;
  65.  
  66. #define WACNAME WACExampleB //EDITME
  67. #define WACPARENT WAComponentClient
  68.  
  69. class WACNAME : public WACPARENT {
  70. public:
  71.   WACNAME();
  72.   virtual ~WACNAME();
  73.  
  74.   virtual const char *getName();
  75.   virtual GUID getGUID();
  76.   virtual void onCreate();
  77.   virtual void onDestroy();
  78. // WCS: START vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  79.   virtual void onRegisterServices();
  80. // WCS: END   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  81.  
  82.   virtual RootWnd * createWindow(int n, RootWnd *parentWnd);
  83.   const char *getWindowName();
  84. // WCS: START vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  85.   int destroyWindow(RootWnd * deadWnd);
  86.   ThingerBitmapInfo getThingerBitmapInfo();
  87.  
  88. //
  89. // ===========================================================================
  90. // ===========================================================================
  91. //
  92. //  These items are needed for our component to be used as a Window Creation
  93. // object.
  94. public:
  95.  
  96. #if 0  // Add this code to your constructor.
  97.   WACNAME() {
  98.     // Only allow a single instance to be constructed.
  99.     ASSERT( myInstance == NULL );
  100.     myInstance = this;
  101.   }
  102. #endif
  103.  
  104.   static WACNAME & Main() {
  105.     // Make that instance available as a static item.
  106.     return * myInstance;
  107.   }
  108.   //  
  109.   //  Therefore, if we wish, we can call down to that instance
  110.   // to handle any of the necessary function calls required by
  111.   // the template.  Hooray for legacy code support.
  112.   //
  113.  
  114.   //
  115.   //  The rest of the methods listed here are the required static
  116.   // methods for any object that is passed into the above template.
  117.   //
  118.   // =========================================================================
  119.   //
  120.   static const char *getWindowNameStatic() { 
  121.     return Main().getName(); 
  122.   }
  123.   //
  124.   static GUID getGUIDStatic() { 
  125.     return Main().getGUID(); 
  126.   }
  127.   //
  128.   static RootWnd *createWindowStatic(int n, RootWnd *parentWnd) {
  129.     return Main().createWindow(n, parentWnd);
  130.   }
  131.   //
  132.   static int destroyWindowStatic(RootWnd *deadWnd) {
  133.     return Main().destroyWindow(deadWnd);
  134.   }
  135.   //
  136.   // If you are going to be using the Thinger template, 
  137.   // you also must provide the following method:
  138.   //
  139.   static ThingerBitmapInfo getThingerBitmapInfoStatic() {
  140.     return Main().getThingerBitmapInfo();
  141.   }
  142.  
  143. private:
  144.   static WACNAME *     myInstance;
  145. // WCS: END   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  146.  
  147. // ===========================================================================
  148. private:
  149.   ExampleBWnd *wnd;
  150. };
  151.  
  152. #endif
  153.